package com.jiazhong.servlets;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


public class ServletTest01  extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       resp.setContentType("text/html;charset=UTF-8");//防止浏览器显示乱码响应乱码

        final String username = req.getParameter("username");
        System.out.println(username);
        if ("zhangsan".equals(username)) {
            resp.getWriter().write("已存在");
        }else {
            resp.getWriter().write("可用");
        }
    }
}
